package com.aiyige.model.moment.entity;

import com.aiyige.model.moment.backup.TagBackup;

import java.util.List;

/**
 * 功能: 收藏记录. <br/>
 *
 * @author wangzhijun
 * @date 2018-01-16 17:54
 * @version
 * @since JDK 1.8
 */
public class FavoriteRecord{

    public FavoriteRecord() {

    }
    private String id;

    /**
     * MomentID
     */
    private String momentId;
    /**
     * Moment信息备份
     */
    private Moment momentBackup;
    /**
     * Moment的主题
     */
    private String momentSubject;
    /**
     * Moment的标题
     */
    private String momentTitle;
    /**
     * Moment的标签
     */
    private List<TagBackup> momentTags;
    /**
     * 收藏人ID
     */
    private String creator;
    /**
     * 收藏时间
     */
    private Long createTime;

    public boolean isSearch() {
        return isSearch;
    }

    public void setSearch(boolean search) {
        isSearch = search;
    }

    private boolean isSearch;

    private FavoriteRecord(Builder builder) {
        setId(builder.id);
        setMomentId(builder.momentId);
        setMomentBackup(builder.momentBackup);
        setMomentSubject(builder.momentSubject);
        setMomentTitle(builder.momentTitle);
        setMomentTags(builder.momentTags);
        setCreator(builder.creator);
        setCreateTime(builder.createTime);
    }

    public boolean isSelected() {
        return isSelected;
    }

    public void setSelected(boolean selected) {
        isSelected = selected;
    }

    private boolean isSelected;

    public static Builder newBuilder() {
        return new Builder();
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getMomentId() {
        return momentId;
    }

    public void setMomentId(String momentId) {
        this.momentId = momentId;
    }

    public Moment getMomentBackup() {
        return momentBackup;
    }

    public void setMomentBackup(Moment momentBackup) {
        this.momentBackup = momentBackup;
    }

    public String getMomentSubject() {
        return momentSubject;
    }

    public void setMomentSubject(String momentSubject) {
        this.momentSubject = momentSubject;
    }

    public String getMomentTitle() {
        return momentTitle;
    }

    public void setMomentTitle(String momentTitle) {
        this.momentTitle = momentTitle;
    }

    public List<TagBackup> getMomentTags() {
        return momentTags;
    }

    public void setMomentTags(List<TagBackup> momentTags) {
        this.momentTags = momentTags;
    }

    public String getCreator() {
        return creator;
    }

    public void setCreator(String creator) {
        this.creator = creator;
    }

    public Long getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Long createTime) {
        this.createTime = createTime;
    }

    public static final class Builder {
        private String id;
        private String momentId;
        private Moment momentBackup;
        private String momentSubject;
        private String momentTitle;
        private List<TagBackup> momentTags;
        private String creator;
        private Long createTime;

        private Builder() {
        }

        public Builder id(String id) {
            this.id = id;
            return this;
        }

        public Builder momentId(String momentId) {
            this.momentId = momentId;
            return this;
        }

        public Builder momentBackup(Moment momentBackup) {
            this.momentBackup = momentBackup;
            return this;
        }

        public Builder momentSubject(String momentSubject) {
            this.momentSubject = momentSubject;
            return this;
        }

        public Builder momentTitle(String momentTitle) {
            this.momentTitle = momentTitle;
            return this;
        }

        public Builder momentTags(List<TagBackup> momentTags) {
            this.momentTags = momentTags;
            return this;
        }

        public Builder creator(String creator) {
            this.creator = creator;
            return this;
        }

        public Builder createTime(Long createTime) {
            this.createTime = createTime;
            return this;
        }

        public FavoriteRecord build() {
            return new FavoriteRecord(this);
        }
    }
}
